package behavior.mediator;

/**
 * @author dali
 * @date 2021-07-27 11:04
 * @Description
 */

public class Client {
    public static void main(String[] args) {
        //创建中介
        Mediator mediator = new ConcreteMediator();
        //创建三位具体同事
        Colleague colleague1 = new ConcreteColleague1();
        Colleague colleague2 = new ConcreteColleague2();
        Colleague colleague3 = new ConcreteColleague3();
        //中介者记录每个同事类
        mediator.register(colleague1);
        mediator.register(colleague2);
        mediator.register(colleague3);
        //某个同事发送消息
        colleague1.send();
    }
}
